package com.ssm.xml.service.impl;

import com.ssm.xml.entity.SysUser;
import com.ssm.xml.mapper.UserMapper;
import com.ssm.xml.service.UserService;

import java.util.List;

/**
 * @author: Hsiao
 * @date: 2023-11-21
 * @description:
 */
public class UserServiceImpl implements UserService {
    private UserMapper userMapper;

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public int add(SysUser user) {
        return userMapper.insert(user);
    }

    @Override
    public int removeById(Integer id) {
        return userMapper.deleteById(id);
    }

    @Override
    public int save(SysUser user) {
        return userMapper.update(user);
    }

    @Override
    public SysUser getById(Integer id) {
        return userMapper.selectById(id);
    }

    @Override
    public List<SysUser> list(SysUser user) {
        return userMapper.selectList(user);
    }

    @Override
    public List<SysUser> listAll() {
        return userMapper.selectAll();
    }
}
